Suppress sleep on linux using dbus inhibitor lock#1137
Suppress sleep on linux using dbus inhibitor lock#1137ConnorC432 wants to merge 8 commits intoPokemonAutomation:mainfrom
Conversation
|
I'm attempting this fix ConnorC432#1 Should be trivial but let's wait for CI to run before merging ! |
|
i have bundled libsdbus-c++ 2.2.1, and managed to build it on ubuntu 24. It just requires the libsystemd-dev package |
Install libsdbus-c++-dev
| sudo apt update | ||
| sudo apt upgrade | ||
| sudo apt install clang-tools libopencv-dev | ||
| sudo apt install clang-tools libopencv-dev libsdbus-c++-dev libsystemd-dev |
There was a problem hiding this comment.
is libsdbus-c++-dev still needed ?
SerialPrograms/CMakeLists.txt
Outdated
| target_link_libraries(SerialPrograms PRIVATE sdbus-c++) | ||
| else() | ||
| # Use bundled library | ||
| message(STATUS "sdbus-c++ >= 2.2.1 not found, using bundled library") |
There was a problem hiding this comment.
why not always use the bundled one ?
| template <typename Connection> | ||
| auto make_login1_proxy(Connection& connection) | ||
| { | ||
| return make_login1_proxy(connection, 0); |
There was a problem hiding this comment.
you can simplify a lot the code as we do have C++20 !
| return make_login1_proxy(connection, 0); | |
| if constexpr (requires { sdbus::BusName{"org.freedesktop.login1"}; }) { | |
| return sdbus::createProxy(connection, | |
| sdbus::BusName{"org.freedesktop.login1"}, | |
| sdbus::ObjectPath{"/org/freedesktop/login1"}); | |
| } else { | |
| return sdbus::createProxy(connection, | |
| "org.freedesktop.login1", | |
| "/org/freedesktop/login1"); | |
| } |
There was a problem hiding this comment.
9497646 reverts this change, when using bundled sdbus 2.2.1 the strongly typed api is fine on its own
might still be worth adding this in case there are conflicts between sdbus 2.2.1 and an older libsystemd?
This reverts commit 92dacba.
|
Verbally approving for the changes to our code. I'll let pif do the final merge when CI when everything is clear. |
|
All good for me, I already approved! There is a merge conflict though |
#535
Sleep controller implementation (3f812f2) for linux that allows for both the screen to be kept on all the time, and for the screen to be turned off while preventing sleep.